{% extends 'admin/base_site.html' %}

{% comment %}

 Copyright 2013 - Tom Alessi

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and 
 limitations under the License.

{% endcomment %}
{% block content %}
<br>
<br>
<form name="config" method="POST" action="/admin/config">
{% csrf_token %}
<table>
 
 {% if form.errors %}
 <tr>
  <td colspan="4" bgcolor="yellow">
   {% if form.max_keyword_results.errors %}
    Maximum Keyword Results error: {% for error in form.max_keyword_results.errors %}{{error}}{% endfor %}
    <br>
   {% endif %}
   {% if form.max_google_api_calls.errors %}
    Maximum Google API Calls error: {% for error in form.max_google_api_calls.errors %}{{error}}{% endfor %}
    <br>
   {% endif %}
   {% if form.wpt_attempts.errors %}
    Webpagetest Attempts error: {% for error in form.wpt_attempts.errors %}{{error}}{% endfor %}
    <br>
   {% endif %}
   {% if form.wpt_wait.errors %}
    Webpagetest Wait error: {% for error in form.wpt_wait.errors %}{{error}}{% endfor %}
    <br>
   {% endif %}
   {% if form.seomoz_account_type.errors %}
    SEOMoz Account Type error: {% for error in form.seomoz_account_type.errors %}{{error}}{% endfor %}
    <br>
   {% endif %}
   {% if form.dashboard_refresh.errors %}
    Dashboard Refresh error: {% for error in form.dashboard_refresh.errors %}{{error}}{% endfor %}
    <br>
   {% endif %}
   {% if form.dashboard_slots.errors %}
    Dashboard Slots error: {% for error in form.dashboard_slots.errors %}{{error}}{% endfor %}
    <br>
   {% endif %}
   {% if form.dashboard_width.errors %}
    Dashboard Width error: {% for error in form.dashboard_width.errors %}{{error}}{% endfor %}
    <br>
   {% endif %}
   {% if form.dashboard_height.errors %}
    Dashboard Height error: {% for error in form.dashboard_height.errors %}{{error}}{% endfor %}
    <br>
   {% endif %}
   {% if form.dashboard_font.errors %}
    Dashboard Font error: {% for error in form.dashboard_font.errors %}{{error}}{% endfor %}
    <br>
   {% endif %}
   {% if form.dashboard_frequency.errors %}
    Dashboard Frequency error: {% for error in form.dashboard_frequency.errors %}{{error}}{% endfor %}
    <br>
   {% endif %}
   {% if form.pagespeed_locale.errors %}
    Pagespeed Locale error: {% for error in form.pagespeed_locale.errors %}{{error}}{% endfor %}
    <br>
   {% endif %}
   {% if form.pagespeed_threads.errors %}
    Pagespeed Threads error: {% for error in form.pagespeed_threads.errors %}{{error}}{% endfor %}
    <br>
   {% endif %}
   {% if form.wpt_threads.errors %}
    Webpagetest Threads error: {% for error in form.wpt_threads.errors %}{{error}}{% endfor %}
    <br>
   {% endif %}
   {% if form.report_path.errors %}
    Report Path error: {% for error in form.report_path.errors %}{{error}}{% endfor %}
    <br>
   {% endif %}
  </td>
 </tr>
 {% endif %}

 <tr>
  <th width="200">Parameter</th>
  <th width="300">Current Value</th>
  <th>Update</th>
  <th>New Value</th>
 </tr>


 {% for config in configs %}
 <tr>
  <td><span title="{{config.description}}">{{config.friendly_name}}</span></td>
  {% if config.display == 'password' %}
    <td>********</td>
    <td><input type="checkbox" name="update_{{config.config_name}}"</td>
    <td><input type="password" name="{{config.config_name}}" value=""></td>
  {% else %}
   {% if config.display == 'boolean' %}
    <td>{% if config.config_value == '1' %}True{% else %}False{% endif %}</td>
    <td><input type="checkbox" name="update_{{config.config_name}}"</td>
    <td>
     <select name="{{config.config_name}}">
      {% if config.config_value == '1' %}
       <option value="0" selected>False</option>
       <option value="1">True</option>
      {% else %}
       <option value="0">False</option>
       <option value="1" selected>True</option>
      {% endif %}
    </td>
   {% else %}
    <td>{{config.config_value}}</td>
    <td><input type="checkbox" name="update_{{config.config_name}}"</td>
    <td><input type="text" name="{{config.config_name}}" value=""></td>
   {% endif %}
  {% endif %}
 </tr>
 {% endfor %}
 </tr>
 <tr>
  <td align="left" colspan="5">
   <input type="submit" value="save">
  </td>
 </tr>
 <tr>
  <td align="left" colspan="5">
   Hover over the parameter names for a description.
  </td>
 </tr>
</table>
</form>

{% endblock %}

